<html>
	<head>
		<title>Artikel manager</title>
	</head>
	<body>
		<h1>Artikel manager</h1>
		<?php echo form_open("admin/article/read/", array("method" => "POST")); ?>
            <label>Categorieen:</label>
            <select name="category_id">
                <option value="">alle artikelen</option>
               <?php foreach($categories as $category) :?>
                <?php if($category_id == $category->id): ?>
                       <option value="<?php echo $category->id; ?>" selected="selected"><?php echo $category->title_nl; ?></option>                
                <?php else: ?>
                  <option value="<?php echo $category->id; ?>"><?php echo $category->title_nl; ?></option>  
                <?php endif; ?>
               <?php endforeach; ?>
            </select>
            <input type="submit" value="Sorteren" />
        </form>
		<?php echo anchor("admin", "<img src='http://cdn1.iconfinder.com/data/icons/sem_labs_icon_pack/icons/arrow_return_up_left.png' />"); ?>
		<?php echo anchor("admin/article/create/", "<img src='http://cdn1.iconfinder.com/data/icons/Free-PSD-blogging-icons-Bimbilini/64/article_add.png' />"); ?>
		<ul>
		<?php echo form_open("admin/article/make_frontpage/", array("method"=> "GET"))?>
		<?php foreach($articles as $article):?>
			<li>
			<?php if($article->is_frontpage):?>
				<input type="hidden" name="old_id" value="<?php echo $article->id;?>" />
				<input type="radio" checked name="article_id" value="<?php echo $article->id;?>" />
			<?php else: ?>
				<input type="radio" name="article_id" value="<?php echo $article->id;?>" />
			<?php endif; ?>
			<?php echo anchor("admin/article/edit/".$article->id."/?category_id=".$article->category_id."", $article->title); ?> 
			<?php if($article->is_frontpage):?>
				<img src="http://cdn1.iconfinder.com/data/icons/dortmund/dortmund-16x16/home.png" />
			<?php endif;?>
			<?php if(!$article->is_frontpage):?>
			<span style="float: right;"><b>Categorie: </b> <?php echo $category->title_nl; ?></span>
			<?php else: ?>
				
			<?php endif;?>
			</li>
		<?php endforeach;?>
		<p />
		<input type="submit" value="Maak artikel de homepagina" />
		</form>
		</ul>
	</body>
</html>